//---------------------------------------------------------------------------

#ifndef CEICQueryH
#define CEICQueryH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <dbtables.hpp>
#include <ibquery.hpp>
#include <db.hpp>
#include <ibdatabase.hpp>

#include "CEICDatabase.h"
//---------------------------------------------------------------------------
enum CEICUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApply, uaApplied };
typedef void __fastcall (__closure *CEICUpdateErrorEvent)(Db::TDataSet* DataSet, Db::EDatabaseError* E, Db::TUpdateKind UpdateKind, CEICUpdateAction &UpdateAction);
typedef void __fastcall (__closure *CEICUpdateRecordEvent)(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind, CEICUpdateAction &UpdateAction);

class PACKAGE CEICQuery : public TDataSet
{
private:
  friend class TDataSet;
  TQuery*                  FQuery;
  TIBQuery*                FIBQuery;
  CEICDatabase*            FDataBase;
  CEICUpdateErrorEvent     FUpdateErrorEvent;
  CEICUpdateRecordEvent    FUpdateRecordEvent;
  //CEICDataSetUpdateObject* FDataSetUpdateObject;

  //Variables temporaires pour pré-initialisation avant création du TDatabase ou du TIBDatabase
    //des Propriétés Published
      bool                     FActive;
      bool                     FCachedUpdates;
      TCheckConstraints*       FConstraints;
      Db::TDataSource*         FDataSource;
      bool                     FParamCheck;
      Db::TParams*             FParams;
      Classes::TStrings*       FSQL;
      bool                     FUniDirectional;
      Db::TUpdateMode          FUpdateMode;
      bool                     FObjectView;
      //TDataSetUpdateObject*    FUpdateObject_Tmp;
      //CEICDataSetUpdateObject* FUpdateObject_Tmp;

  bool                       __fastcall GetActive(void);
  TFields*                   __fastcall GetAggFields(void);
  bool                       __fastcall GetAutoCalcFields(void);
  void                       __fastcall SetAutoCalcFields(bool Value);
  bool                       __fastcall GetBOF(void);
  bool                       __fastcall GetCachedUpdates(void);
  TCheckConstraints*         __fastcall GetConstraints(void);
  void                       __fastcall SetConstraints(TCheckConstraints* Value);
  CEICDatabase*              __fastcall GetDatabase(void);
  void                       __fastcall SetDatabase(CEICDatabase* Value);
  TDataSetField*             __fastcall GetDataSetField(void);
  bool                       __fastcall GetDefaultFields(void);
  TDataSetDesigner*          __fastcall GetDesigner(void);
  bool                       __fastcall GetEOF(void);
  int                        __fastcall GetFieldCount(void);
  TFieldDefList*             __fastcall GetFieldDefList(void);
  TFieldDefs*                __fastcall GetFieldDefs(void);
  void                       __fastcall SetFieldDefs(TFieldDefs* Value);
  TFieldList*                __fastcall GetFieldList(void);
  TFields*                   __fastcall GetFields(void);
  Variant                    __fastcall GetFieldValue(const AnsiString FieldName);
  void                       __fastcall SetFieldValue(const AnsiString FieldName, const Variant &Value);
  bool                       __fastcall GetFound(void);
  bool                       __fastcall GetModified(void);
  bool                       __fastcall GetObjectView(void);
  bool                       __fastcall GetParamCheck(void);
  Db::TParams*               __fastcall GetParamsList(void);
  void                       __fastcall SetParamsList(Db::TParams* Value);
  bool                       __fastcall GetPrepare(void);
  Classes::TStrings*         __fastcall GetQuery(void);
  void                       __fastcall SetQuery(Classes::TStrings* Value);
  bool                       __fastcall GetSparseArrays(void);
  void                       __fastcall SetSparseArrays(bool Value);
  TDataSetState              __fastcall GetState(void);
  AnsiString                 __fastcall GetText(void);
  bool                       __fastcall GetUniDirectional(void);
  void                       __fastcall SetUniDirectional(bool Value);
  void                       __fastcall DbUpdateErrorEvent(   Db::TDataSet* DataSet, Db::EDatabaseError* E, Db::TUpdateKind UpdateKind, TUpdateAction   &UpdateAction);
  void                       __fastcall DbUpdateRecordEvent(  Db::TDataSet* DataSet,                        Db::TUpdateKind UpdateKind, TUpdateAction   &UpdateAction);
  void                       __fastcall IBDbUpdateErrorEvent( Db::TDataSet* DataSet, Db::EDatabaseError* E, Db::TUpdateKind UpdateKind, TIBUpdateAction &UpdateAction);
  void                       __fastcall IBDbUpdateRecordEvent(Db::TDataSet* DataSet,                        Db::TUpdateKind UpdateKind, TIBUpdateAction &UpdateAction);
  Db::TUpdateMode            __fastcall GetUpdateMode(void);
  //TDataSetUpdateObject*      __fastcall GetUpdateObject(void);
  //CEICDataSetUpdateObject*   __fastcall GetUpdateObject(void);

  TDataSetNotifyEvent        __fastcall GetAfterCancel(void);
	TDataSetNotifyEvent        __fastcall GetAfterClose(void);
	TDataSetNotifyEvent        __fastcall GetAfterDelete(void);
	TDataSetNotifyEvent        __fastcall GetAfterEdit(void);
	TDataSetNotifyEvent        __fastcall GetAfterInsert(void);
	TDataSetNotifyEvent        __fastcall GetAfterOpen(void);
	TDataSetNotifyEvent        __fastcall GetAfterPost(void);
	TDataSetNotifyEvent        __fastcall GetAfterRefresh(void);
	TDataSetNotifyEvent        __fastcall GetAfterScroll(void);
	TDataSetNotifyEvent        __fastcall GetBeforeCancel(void);
	TDataSetNotifyEvent        __fastcall GetBeforeClose(void);
	TDataSetNotifyEvent        __fastcall GetBeforeDelete(void);
	TDataSetNotifyEvent        __fastcall GetBeforeEdit(void);
	TDataSetNotifyEvent        __fastcall GetBeforeInsert(void);
	TDataSetNotifyEvent        __fastcall GetBeforeOpen(void);
	TDataSetNotifyEvent        __fastcall GetBeforePost(void);
	TDataSetNotifyEvent        __fastcall GetBeforeRefresh(void);
	TDataSetNotifyEvent        __fastcall GetBeforeScroll(void);
	TDataSetNotifyEvent        __fastcall GetOnCalcFields(void);
	TDataSetErrorEvent         __fastcall GetOnDeleteError(void);
	TDataSetErrorEvent         __fastcall GetOnEditError(void);
  TFilterRecordEvent         __fastcall GetOnFilterRecord(void);
  TDataSetNotifyEvent        __fastcall GetOnNewRecord(void);
	TDataSetErrorEvent         __fastcall GetOnPostError(void);

  void __fastcall RemoveDataSource(TDataSource* DataSource);
  void __fastcall AddDataSource(TDataSource* DataSource);

protected:
  virtual void             __fastcall SetActive(bool Value);
  virtual AnsiString       __fastcall GetBookmarkStr();
  virtual void             __fastcall SetBookmarkStr(const AnsiString Value);
          void             __fastcall SetCachedUpdates(bool Value);
          bool             __fastcall ConstraintsStored(void);
  virtual Db::TDataSource* __fastcall GetDataSource(void);
          void             __fastcall SetDataSource(Db::TDataSource* Value);
  virtual void             __fastcall SetDataSetField(const TDataSetField* Value);
          void             __fastcall SetObjectView(const bool Value);
          void             __fastcall SetParamCheck(bool Value);
          Word             __fastcall GetParamsCount(void);
          void             __fastcall SetPrepare(bool Value);
          int              __fastcall GetRowsAffected(void);
          void             __fastcall SetState(TDataSetState Value);
          void             __fastcall SetUpdateMode(const Db::TUpdateMode Value);
          //void             __fastcall SetUpdateObject(TDataSetUpdateObject* Value);
          //void             __fastcall SetUpdateObject(CEICDataSetUpdateObject* Value);
          bool             __fastcall GetUpdatesPending(void);

          int              __fastcall GetBlockReadSize(void);
          AnsiString       __fastcall GetFilterText(void);
          bool             __fastcall GetFiltered(void);
          TFilterOptions   __fastcall GetFilterOptions(void);

  virtual void             __fastcall SetAfterCancel(   const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterClose(    const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterDelete(   const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterEdit(     const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterInsert(   const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterOpen(     const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterPost(     const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterRefresh(  const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetAfterScroll(   const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeCancel(  const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeClose(   const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeDelete(  const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeEdit(    const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeInsert(  const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeOpen(    const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforePost(    const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeRefresh( const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetBeforeScroll(  const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetOnCalcFields(  const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetOnDeleteError( const TDataSetErrorEvent  Value);
  virtual void             __fastcall SetOnEditError(   const TDataSetErrorEvent  Value);
  virtual void             __fastcall SetOnFilterRecord(const TFilterRecordEvent  Value);
  virtual void             __fastcall SetOnNewRecord(   const TDataSetNotifyEvent Value);
  virtual void             __fastcall SetOnPostError(   const TDataSetErrorEvent  Value);

  // Redéfinition des fonctions "virtual" de la section Protected du TQuery ou TIBQuery
  virtual char *           __fastcall AllocRecordBuffer(void);
  virtual void 		         __fastcall DefineProperties(Classes::TFiler* Filer);
  virtual void 			       __fastcall Disconnect(void);
	virtual void             __fastcall FreeRecordBuffer(char * &Buffer);
	virtual void             __fastcall GetBookmarkData(char * Buffer, void * Data);
	virtual TBookmarkFlag    __fastcall GetBookmarkFlag(char * Buffer);
  virtual bool             __fastcall GetFieldData(TField* Field, void * Buffer, bool NativeFormat);
	virtual TGetResult       __fastcall GetRecord(char * Buffer, TGetMode GetMode, bool DoCheck);
	virtual Word             __fastcall GetRecordSize(void);
	virtual void             __fastcall InternalAddRecord(void * Buffer, bool Append);
	virtual void             __fastcall InternalClose(void);
	virtual void             __fastcall InternalDelete(void);
	virtual void             __fastcall InternalFirst(void);
	virtual void             __fastcall InternalGotoBookmark(void * Bookmark);
	virtual void             __fastcall InternalHandleException(void);
	virtual void             __fastcall InternalInitFieldDefs(void);
	virtual void             __fastcall InternalInitRecord(char * Buffer);
	virtual void             __fastcall InternalLast(void);
	virtual void             __fastcall InternalOpen(void);
	virtual void             __fastcall InternalPost(void);
	virtual void             __fastcall InternalSetToRecord(char * Buffer);
	virtual bool             __fastcall IsCursorOpen(void);
  virtual void             __fastcall PSExecute(void);
	virtual TParams*         __fastcall PSGetParams(void);
	virtual AnsiString       __fastcall PSGetTableName();
	virtual void             __fastcall PSSetParams(TParams* AParams);
	virtual void             __fastcall PSSetCommandText(const AnsiString CommandText);
	virtual void             __fastcall SetBookmarkFlag(char * Buffer, TBookmarkFlag Value);
	virtual void             __fastcall SetBookmarkData(char * Buffer, void * Data);
	virtual void             __fastcall SetFieldData(TField* Field, void * Buffer);
  virtual void             __fastcall SetFieldData(TField* Field, void * Buffer, bool NativeFormat);

  // Redéfinition des fonctions "virtual" de la section Protected du TDataSet
  virtual void             __fastcall ActivateBuffers(void);
  virtual void             __fastcall BlockReadNext(void);
  virtual void             __fastcall CalculateFields(char * Buffer);
	virtual void             __fastcall CheckActive(void);
	virtual void             __fastcall CheckFieldCompatibility(TField* Field, TFieldDef* FieldDef);
	virtual void             __fastcall CheckInactive(void);
	virtual void             __fastcall ClearBuffers(void);
	virtual void             __fastcall ClearCalcFields(char * Buffer);
	virtual void             __fastcall CloseBlob(TField* Field);
	virtual void             __fastcall CloseCursor(void);
	virtual void             __fastcall CreateFields(void);
	virtual TDataSet*        __fastcall CreateNestedDataSet(TDataSetField* DataSetField);
	virtual void             __fastcall DataConvert(TField* Field, void * Source, void * Dest, bool ToNative);
	virtual void             __fastcall DataEvent(TDataEvent Event, int Info);
	virtual void             __fastcall DefChanged(System::TObject* Sender);
	virtual void             __fastcall DestroyFields(void);
	virtual void             __fastcall DoAfterCancel(void);
	virtual void             __fastcall DoAfterClose(void);
	virtual void             __fastcall DoAfterDelete(void);
	virtual void             __fastcall DoAfterEdit(void);
	virtual void             __fastcall DoAfterInsert(void);
	virtual void             __fastcall DoAfterOpen(void);
	virtual void             __fastcall DoAfterPost(void);
	virtual void             __fastcall DoAfterRefresh(void);
	virtual void             __fastcall DoAfterScroll(void);
	virtual void             __fastcall DoBeforeCancel(void);
	virtual void             __fastcall DoBeforeClose(void);
	virtual void             __fastcall DoBeforeDelete(void);
	virtual void             __fastcall DoBeforeEdit(void);
	virtual void             __fastcall DoBeforeInsert(void);
	virtual void             __fastcall DoBeforeOpen(void);
	virtual void             __fastcall DoBeforePost(void);
	virtual void             __fastcall DoBeforeRefresh(void);
	virtual void             __fastcall DoBeforeScroll(void);
	virtual void             __fastcall DoOnCalcFields(void);
	virtual void             __fastcall DoOnNewRecord(void);
	virtual bool             __fastcall FindRecord(bool Restart, bool GoForward);
	virtual void             __fastcall FreeFieldBuffers(void);
	virtual Variant          __fastcall GetAggregateValue(TField* Field);
	virtual int              __fastcall GetAggRecordCount(TGroupPosInd Grp);
  virtual void             __fastcall GetCalcFields(char * Buffer);
	virtual bool             __fastcall GetCanModify(void);
  DYNAMIC void             __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
	virtual TMetaClass*      __fastcall GetFieldClass(TFieldType FieldType);
	virtual AnsiString       __fastcall GetFieldFullName(TField* Field);
	virtual Variant          __fastcall GetStateFieldValue(TDataSetState State, TField* Field);
	virtual bool             __fastcall GetIsIndexField(TField* Field);
	virtual int              __fastcall GetNextRecords(void);
	virtual bool             __fastcall GetNextRecord(void);
	virtual int              __fastcall GetPriorRecords(void);
	virtual bool             __fastcall GetPriorRecord(void);
	virtual int              __fastcall GetRecordCount(void);
	virtual int              __fastcall GetRecNo(void);
  virtual void             __fastcall InitFieldDefs(void);
	virtual void             __fastcall InitRecord(char * Buffer);
	virtual void             __fastcall InternalCancel(void);
	virtual void             __fastcall InternalEdit(void);
	virtual void             __fastcall InternalInsert(void);
	virtual void             __fastcall InternalRefresh(void);
	virtual void             __fastcall Loaded(void);
  virtual void             __fastcall OpenCursor(bool InfoQuery);
  virtual void             __fastcall PSEndTransaction(bool Commit);
	virtual int              __fastcall PSExecuteStatement(const AnsiString ASQL, TParams* AParams, void * ResultSet);
	virtual void             __fastcall PSGetAttributes(Classes::TList* List);
	virtual TIndexDef*       __fastcall PSGetDefaultOrder(void);
	virtual AnsiString       __fastcall PSGetKeyFields();
	virtual AnsiString       __fastcall PSGetQuoteChar();
	virtual TIndexDefs*      __fastcall PSGetIndexDefs(TIndexOptions IndexTypes);
	virtual EUpdateError*    __fastcall PSGetUpdateException(Sysutils::Exception* E, EUpdateError* Prev);
	virtual bool             __fastcall PSInTransaction(void);
	virtual bool             __fastcall PSIsSQLBased(void);
	virtual bool             __fastcall PSIsSQLSupported(void);
	virtual void             __fastcall PSReset(void);
	virtual void             __fastcall PSStartTransaction(void);
	virtual bool             __fastcall PSUpdateRecord(TUpdateKind UpdateKind, TDataSet* Delta);
  virtual void             __fastcall RefreshInternalCalcFields(char * Buffer);
	virtual void             __fastcall ResetAggField(TField* Field);
	virtual void             __fastcall SetBlockReadSize(int Value);
	DYNAMIC void             __fastcall SetChildOrder(Classes::TComponent* Component, int Order);
	virtual void             __fastcall SetCurrentRecord(int Index);
	virtual void             __fastcall SetFiltered(bool Value);
	virtual void             __fastcall SetFilterOptions(TFilterOptions Value);
	virtual void             __fastcall SetFilterText(const AnsiString Value);
	virtual void             __fastcall SetRecNo(int Value);
	virtual void             __fastcall SetStateFieldValue(TDataSetState State, TField* Field, const Variant &Value);
	        void             __fastcall UpdateBufferCount(void);
  virtual void             __fastcall UpdateIndexDefs(void);

public:
  virtual __fastcall ~CEICQuery();
  __fastcall CEICQuery(TComponent* Owner);

  __property TQuery*   BDEQuery = {read=FQuery,   write=FQuery};
  __property TIBQuery* IBQuery  = {read=FIBQuery, write=FIBQuery};

  __property TFields*                   AggFields                         = {read=GetAggFields};
  __property bool                       Bof                               = {read=GetBOF,                                     nodefault};
  __property AnsiString                 Bookmark                          = {read=GetBookmarkStr,    write=SetBookmarkStr};
  __property bool                       CanModify                         = {read=GetCanModify,                               nodefault};
  __property TDataSetField*             DataSetField                      = {read=GetDataSetField,   write=SetDataSetField};
  __property bool                       DefaultFields                     = {read=GetDefaultFields,                           nodefault};
  __property TDataSetDesigner*          Designer                          = {read=GetDesigner};
  __property bool                       Eof                               = {read=GetEOF,                                     nodefault};
  __property int                        FieldCount                        = {read=GetFieldCount,                              nodefault};
  __property TFieldDefList*             FieldDefList                      = {read=GetFieldDefList};
  __property TFieldDefs*                FieldDefs                         = {read=GetFieldDefs,      write=SetFieldDefs};
  __property TFieldList*                FieldList                         = {read=GetFieldList};
  __property TFields*                   Fields                            = {read=GetFields};
  __property Variant                    FieldValues[AnsiString FieldName] = {read=GetFieldValue,     write=SetFieldValue};
  __property bool                       Found                             = {read=GetFound,                                   nodefault};
  __property bool                       Modified                          = {read=GetModified,                                nodefault};
 	__property Word                       ParamCount                        = {read=GetParamsCount,                             nodefault};
  __property bool                       Prepared                          = {read=GetPrepare,        write=SetPrepare,        nodefault};
  __property int                        RowsAffected                      = {read=GetRowsAffected,                            nodefault};
  __property bool                       SparseArrays                      = {read=GetSparseArrays,   write=SetSparseArrays,   nodefault};
  __property TDataSetState              State                             = {read=GetState,                                   nodefault};
  __property AnsiString                 Text                              = {read=GetText};
  __property bool                       UpdatesPending                    = {read=GetUpdatesPending,                          nodefault};


  __property int            BlockReadSize = {read=GetBlockReadSize, write=SetBlockReadSize, nodefault};
	__property int            RecordCount   = {read=GetRecordCount,                           nodefault};
	__property int            RecNo         = {read=GetRecNo,         write=SetRecNo,         nodefault};
	__property Word           RecordSize    = {read=GetRecordSize,                            nodefault};
	__property AnsiString     Filter        = {read=GetFilterText,    write=SetFilterText};
	__property bool           Filtered      = {read=GetFiltered,      write=SetFiltered,      default=0};
	__property TFilterOptions FilterOptions = {read=GetFilterOptions, write=SetFilterOptions, default=0};

            char*             __fastcall ActiveBuffer(void);
            void              __fastcall Append(void);
            void              __fastcall AppendRecord(const System::TVarRec * Values, const int Values_Size);
            void              __fastcall ApplyUpdates(void);
            void              __fastcall CancelUpdates(void);
            void              __fastcall CheckBrowseMode(void);
            void              __fastcall ClearFields(void);
            void              __fastcall Close(void);
  virtual   int               __fastcall CompareBookmarks(void * Bookmark1, void * Bookmark2);
            bool              __fastcall ControlsDisabled(void);
  virtual   Classes::TStream* __fastcall CreateBlobStream(Db::TField* Field, Db::TBlobStreamMode Mode);
            void              __fastcall CursorPosChanged(void);
            void              __fastcall Delete(void);
	          void              __fastcall DisableControls(void);
	          void              __fastcall Edit(void);
	          void              __fastcall EnableControls(void);
            void              __fastcall ExecSQL(void);
            void              __fastcall FetchAll(void);
            TField*           __fastcall FieldByName(const AnsiString FieldName);
	          TField*           __fastcall FindField(const AnsiString FieldName);
	          bool              __fastcall FindFirst(void);
	          bool              __fastcall FindLast(void);
	          bool              __fastcall FindNext(void);
	          bool              __fastcall FindPrior(void);
	          void              __fastcall First(void);
  virtual   void              __fastcall FreeBookmark(void * Bookmark);
	virtual   void*             __fastcall GetBookmark(void);
  virtual   bool              __fastcall GetCurrentRecord(char * Buffer);
            void              __fastcall GetDetailDataSets(Classes::TList* List);
  virtual   void              __fastcall GetDetailLinkFields(Classes::TList* MasterFields, Classes::TList* DetailFields);
  virtual   bool              __fastcall GetFieldData(Db::TField* Field, void * Buffer);
	virtual   bool              __fastcall GetFieldData(int FieldNo, void * Buffer);
            void              __fastcall GetFieldList(Classes::TList* List, const AnsiString FieldNames);
	          void              __fastcall GetFieldNames(Classes::TStrings* List);
	          void              __fastcall GotoBookmark(void * Bookmark);
	HIDESBASE void              __fastcall Insert(void);
	          void              __fastcall InsertRecord(const System::TVarRec * Values, const int Values_Size);
	          bool              __fastcall IsEmpty(void);
	          bool              __fastcall IsLinkedTo(TDataSource* DataSource);
            void              __fastcall Last(void);
  virtual   bool              __fastcall Locate(const AnsiString KeyFields, const Variant &KeyValues, Db::TLocateOptions Options);
  virtual   Variant           __fastcall Lookup(const AnsiString KeyFields, const Variant &KeyValues, const AnsiString ResultFields);
            int               __fastcall MoveBy(int Distance);
	          void              __fastcall Next(void);
	          void              __fastcall Open(void);
            Db::TParam*       __fastcall ParamByName(const AnsiString Value);
  virtual   void              __fastcall Post(void);
            void              __fastcall Prepare(void);
            void              __fastcall Prior(void);
            void              __fastcall Refresh(void);
	virtual   void              __fastcall Resync(TResyncMode Mode);
            void              __fastcall RevertRecord(void);
            void              __fastcall SetFields(const System::TVarRec * Values, const int Values_Size);
  virtual   int               __fastcall Translate(char * Src, char * Dest, bool ToOem);
        	  void              __fastcall UnPrepare(void);
            void              __fastcall UpdateCursorPos(void);
	          void              __fastcall UpdateRecord(void);
  virtual   Db::TUpdateStatus __fastcall UpdateStatus(void);

  // Redéfinition des fonctions "virtual" de la section Public du TDataSet
  virtual   bool              __fastcall BookmarkValid(void * Bookmark);
	virtual   void              __fastcall Cancel(void);
	virtual   int               __fastcall GetBlobFieldData(int FieldNo, TBlobByteData &Buffer);
  virtual   bool              __fastcall IsSequenced(void);
	//virtual bool __fastcall GetFieldData(TField* Field, void * Buffer);
		
__published:
  __property bool                     Active         = {read=GetActive,          write=SetActive,         default=0};
  __property bool                     AutoCalcFields = {read=GetAutoCalcFields,  write=SetAutoCalcFields, default=1};
  __property bool                     CachedUpdates  = {read=GetCachedUpdates,   write=SetCachedUpdates,  nodefault};
  __property TCheckConstraints*       Constraints    = {read=GetConstraints,     write=SetConstraints,    stored=ConstraintsStored};
  __property CEICDatabase*            Database       = {read=GetDatabase,        write=SetDatabase};
  __property Db::TDataSource*         DataSource     = {read=GetDataSource,      write=SetDataSource};
  __property bool                     ObjectView     = {read=GetObjectView,      write=SetObjectView,     nodefault};
  __property bool                     ParamCheck     = {read=GetParamCheck,      write=SetParamCheck,     default=1};
  __property Db::TParams*             Params         = {read=GetParamsList,      write=SetParamsList,     stored=false};
  __property Classes::TStrings*       SQL            = {read=GetQuery,           write=SetQuery};
  __property bool                     UniDirectional = {read=GetUniDirectional,  write=SetUniDirectional, default=0};
  __property Db::TUpdateMode          UpdateMode     = {read=GetUpdateMode,      write=SetUpdateMode, default=0};
  //__property TDataSetUpdateObject*    UpdateObject   = {read=GetUpdateObject,    write=SetUpdateObject};
  //__property CEICDataSetUpdateObject* UpdateObject   = {read=GetUpdateObject,    write=SetUpdateObject};

  __property TDataSetNotifyEvent      AfterCancel    = {read=GetAfterCancel,     write=SetAfterCancel};
  __property TDataSetNotifyEvent      AfterClose     = {read=GetAfterClose,      write=SetAfterClose};
  __property TDataSetNotifyEvent      AfterDelete    = {read=GetAfterDelete,     write=SetAfterDelete};
  __property TDataSetNotifyEvent      AfterEdit      = {read=GetAfterEdit,       write=SetAfterEdit};
  __property TDataSetNotifyEvent      AfterInsert    = {read=GetAfterInsert,     write=SetAfterInsert};
  __property TDataSetNotifyEvent      AfterOpen      = {read=GetAfterOpen,       write=SetAfterOpen};
  __property TDataSetNotifyEvent      AfterPost      = {read=GetAfterPost,       write=SetAfterPost};
  __property TDataSetNotifyEvent      AfterRefresh   = {read=GetAfterRefresh,    write=SetAfterRefresh};
  __property TDataSetNotifyEvent      AfterScroll    = {read=GetAfterScroll,     write=SetAfterScroll};
  __property TDataSetNotifyEvent      BeforeCancel   = {read=GetBeforeCancel,    write=SetBeforeCancel};
  __property TDataSetNotifyEvent      BeforeClose    = {read=GetBeforeClose,     write=SetBeforeClose};
  __property TDataSetNotifyEvent      BeforeDelete   = {read=GetBeforeDelete,    write=SetBeforeDelete};
	__property TDataSetNotifyEvent      BeforeEdit     = {read=GetBeforeEdit,      write=SetBeforeEdit};
	__property TDataSetNotifyEvent      BeforeInsert   = {read=GetBeforeInsert,    write=SetBeforeInsert};
  __property TDataSetNotifyEvent      BeforeOpen     = {read=GetBeforeOpen,      write=SetBeforeOpen};
	__property TDataSetNotifyEvent      BeforePost     = {read=GetBeforePost,      write=SetBeforePost};
	__property TDataSetNotifyEvent      BeforeRefresh  = {read=GetBeforeRefresh,   write=SetBeforeRefresh};
	__property TDataSetNotifyEvent      BeforeScroll   = {read=GetBeforeScroll,    write=SetBeforeScroll};
	__property TDataSetNotifyEvent      OnCalcFields   = {read=GetOnCalcFields,    write=SetOnCalcFields};
	__property TDataSetErrorEvent       OnDeleteError  = {read=GetOnDeleteError,   write=SetOnDeleteError};
	__property TDataSetErrorEvent       OnEditError    = {read=GetOnEditError,     write=SetOnEditError};
	__property TFilterRecordEvent       OnFilterRecord = {read=GetOnFilterRecord,  write=SetOnFilterRecord};
	__property TDataSetNotifyEvent      OnNewRecord    = {read=GetOnNewRecord,     write=SetOnNewRecord};
	__property TDataSetErrorEvent       OnPostError    = {read=GetOnPostError,     write=SetOnPostError};
  __property CEICUpdateErrorEvent     OnUpdateError  = {read=FUpdateErrorEvent,  write=FUpdateErrorEvent};
  __property CEICUpdateRecordEvent    OnUpdateRecord = {read=FUpdateRecordEvent, write=FUpdateRecordEvent};
};
//---------------------------------------------------------------------------
#endif
